<template>
	<div class="home">上海原圈网络科技有限公司 <span>{{this.info ? this.info.nickname : ""}}</span></div>
</template>

<script>
import { mapState, mapMutations } from "vuex";
import request from "@/utils/request";
import Cookies from "js-cookie";
// import utils from "@/utils/utils";
export default {
  name: "home",
  computed: {
    ...mapState(["info"])
  },
  methods: {
    ...mapMutations({
      setInfo: "SET_INFO"
    })
  },
  mounted() {
    // console.log(utils.textMatch('知乎账号咋！!','知乎账号是',0.75));
    if (Cookies.get("openid") && Cookies.get("passport")) {
      request
        .get(this.global.API_URL, {
          action: "getUserinfo"
        })
        .then(response => {
          if (response.obj && response.obj.user) {
            this.setInfo(response.obj.user);
            setTimeout(() => {
              response.obj.user.nickname = "测试";
              this.setInfo(response.obj.user);
            }, 3000);
          }
        });
    }
  }
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="stylus">
.home
  text-align center
  line-height 1rem
  font-size .36rem
  font-weight 600
  color #000
</style>
